﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RAP.Framework.Libary.ServerCacheManager.CacheProxy;

namespace RAP.Framework.Libary.ServerCacheManager
{
  public interface ICacheManager
  {
    ICacheProxy this[string key] { get; }

    object Get(string fullKey);

    object Get(CacheKey keyObj);

    object Get(string fullKey, Func<object> funDefaultValue);

    T Get<T>(string fullKey, T defaultValue = default(T));

    T Get<T>(string fullKey, Func<T> funDefaultValue);

    T Get<T>(CacheKey keyObj, T defaultValue = default(T));

    T Get<T>(CacheKey keyObj, Func<T> funDefaultValue);

    ICacheManager Get(string fullKey, IDictionary valueOutter);

    Task<T> GetAsync<T>(string fullKey);

    ICacheManager Set(string fullKey, object value);

    void SetAsync(string fullKey, object value);

    ICacheManager Clear(string fullKey);

    void ClearAsync(string fullKey);

    IEnumerable<ICacheProxy> CacheProxys { get; }

    ICollection CacheProxyKeys { get; }

    bool Contains(string fullKey);

    Task<bool> ContainsAsync(string fullKey);

    ICacheProxy DefaultCacheProxy { get; }

    ICacheManager ClearAllCacheProxy();
  }
}
